
<template>
  <div class="wrap">
  
    <div class="form">
        <img src="../assets/loginLogo.png" class="logo" alt />
      <div class="btnBox">
        <button class="login" @click="wxLogin">微信登陆</button>
        <button @click="logins">手机号登陆</button>
      </div>
     
    </div>
     <p class="ccc">
        登陆即代表你同意
        <span style="color:rgb(85,178,252)" @click="dialogVisible">《捷报订单许可及服务协议》</span>
      </p>
  </div>
</template>
<style scoped lang="scss">
.ccc {
  font-size: 12px;
  line-height: 30px;
  width: 100%;
  span {
    cursor: pointer;
  }
}
.wrap {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: space-between;
    height: 100vh;
  .logo {
    width: 3.426667rem;
    margin: 1rem auto 1rem;
  }
  .item {
    width: 6.733333rem;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #3fd9c9;
    height: 1.44rem;
    .phone {
      width: 0.533333rem;
      height: 0.533333rem;
      display: block;
    }
    .pass {
      width: 0.466667rem;
      height: 0.533333rem;
      display: block;
    }
    input {
      display: block;
      outline: none;
      border: none;
      flex: 2;
      margin-left: 15px;
      height: 90%;
      color: #3fd9c9;
    }
  }
  .lou {
    display: flex;
    justify-content: space-between;
    width: 6.733333rem;
    margin: 0 auto;
  }
  .w_pass {
    color: #3fd9c9;
    text-align: left;
    // width: 6.733333rem;
    margin-top: 15px;
  }
  .btnBox {
    margin-top: 1rem;
    height: 4rem;
    button {
      height: 1.133333rem;
      width: 6.813333rem;
      border: 1px solid #3fd9c9;
      border-radius: 30px;
      background: transparent;
      color: #3fd9c9;
      outline: none;
      font-size: 16px;
    }
    .login {
      color: #fff;
      background: #3fd9c9;
      margin-bottom: 0.733333rem;
    }
  }
}
</style>
<script>
import { login } from "@/utils/interface";
import { Dialog } from "vant";
console.log(window.location.href);

export default {
  data() {
    return {
      tel: "",
      password: "",
      openid: ""
    };
  },
  created() {
    document.title = "登陆";
  },
  methods: {
    dialogVisible() {
      this.$router.push("/xiyi");
    },
    logins() {
      if (this.getUrlParams("state") && this.getUrlParams("state") != "STATE") {
        window.location.href =
          "http://www.jiebaodingdan.com/customer-mobile?state=" +
          this.getUrlParams("state") +
          "/#/login2";
      } else {
        this.$router.push("/login2");
      }
    },
    wpass() {
      if (this.getUrlParams("state") && this.getUrlParams("state") != "STATE") {
        window.location.href =
          "http://www.jiebaodingdan.com/customer-mobile?state=" +
          this.getUrlParams("state") +
          "/#/wpass";
      } else {
        this.$router.push("/wpass");
      }
    },
    wxLogin() {
      if (this.getUrlParams("state") && this.getUrlParams("state") != "STATE") {
        window.location.href =
          "http://www.jiebaodingdan.com/customer-mobile?state=" +
          this.getUrlParams("state") +
          "/#/auth";
      } else {
        this.$router.push("/auth");
      }
    },
    getUrlParams(name) {
      // 不传name返回所有值，否则返回对应值
      var url = window.location.search;
      if (url.indexOf("?") == 1) {
        return false;
      }
      url = url.substr(1);
      url = url.split("&");
      var name = name || "";
      var nameres;
      // 获取全部参数及其值
      for (var i = 0; i < url.length; i++) {
        var info = url[i].split("=");
        var obj = {};
        obj[info[0]] = decodeURI(info[1]);
        url[i] = obj;
      }
      // 如果传入一个参数名称，就匹配其值
      if (name) {
        for (var i = 0; i < url.length; i++) {
          for (const key in url[i]) {
            if (key == name) {
              nameres = url[i][key];
            }
          }
        }
      } else {
        nameres = url;
      }
      // 返回结果
      return nameres;
    }
  }
};
</script>
<style lang="scss" scoped>
</style>

